package LawsonTransformJava.main;

import java.io.File;
import java.sql.SQLException;

import LawsonTransformJava.pgm.PR512;
import LawsonTransformJava.pgm.PR514;

public class PR512Main extends ClassMain {

	/**
	 * @author edavis
	 */
	
	public static void main(String[] args) {
		System.out.println("CLASSPATH=" + System.getenv("CLASSPATH"));
		System.out.println("OUTPUT_LOCATION:" + OUTPUTLOCATION);
		
		Thread thread1 = null;
		File outFile = new File(OUTPUTLOCATION + "/ACHDSTCSV_" + getDate());
		File errFile = new File(OUTPUTLOCATION + "/ACHDSTCSV_ERROR_" + getDate());
		File convRpt = new File(OUTPUTLOCATION + "/PR512TransformationReport_" + getDate() + ".txt");

		PR512 objDAO = null;

		try{
			objDAO = new PR512(outFile, errFile, convRpt);

			thread1 = new Thread(objDAO);
			objDAO.setWhereClause(" WHERE END_DATE = #01/01/1700# OR END_DATE >= #03/01/2014# ");
			thread1.start();
		} catch (SQLException e) {
			// Could not connect to the database
			System.out.println("SQLException: " + e);
			System.exit(1);
		}
	}
}
